<!DOCTYPE html>
<html>
<head>
    <title>学生评价</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList" id="container_grid">
        <div class="grid-btn">
            <#if shiro.hasPermission("eval:studentevaltask:eval")>
                <a class="btn btn-primary" @click="queryRecordList"><i class="fa fa-pencil-square-o"></i>&nbsp;选择评价任务进行学生评价</a>
            </#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="showRecordList">
            <div class="grid-btn">
                <div class="form-group col-sm-1">
                    <a class="btn btn-warning" @click="reload"><i class="fa fa-chevron-circle-left"></i>&nbsp;返回</a>
                </div>
                <#if shiro.hasPermission("eval:studentevaltask:eval")>
                <div class="form-group col-sm-2">
                    <input type="text" class="form-control" v-model="q.name" @keyup.enter="recordListReload" placeholder="姓名">
                </div>
                <a class="btn btn-default" @click="recordListReload">查询</a>
                <a class="btn btn-primary" @click="gotoAddRecord"><i class="fa fa-plus"></i>&nbsp;新增</a>
                <a class="btn btn-primary" @click="gotoImportRecord"><i class="fa fa-plus"></i>&nbsp;导入</a>
                <a class="btn btn-primary" @click="gotoUpdateRecord"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
                <a class="btn btn-primary" @click="delRecord"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
                </#if>
            </div>
            <table id="recordListJqGrid"></table>
            <div id="recordListJqGridPager"></div>
    </div>

<div v-show="showRecordAdd" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-2 control-label">姓名</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="studentEvalRecord.userName" @click="addUser" placeholder="姓名" readonly/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">分数</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="studentEvalRecord.score" placeholder="分数"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">备注</div>
            <div class="col-sm-10">
                <textarea  class="form-control" v-model="studentEvalRecord.remark" rows="6"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary" id="btnSave" data-loading-text="保存中..." @click="saveRecord" value="确定"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="recordListReload" value="返回"/>
        </div>
    </form>
</div>
<div v-show="showRecordImport" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal" style="width: 800px;">
        <div class="form-group">
            <div class="col-sm-2 control-label">Excel文件</div>
            <div class="col-sm-10">
                <div class="row">
                    <div style="text-align:right;padding:5px">
                        <a :href="'${request.contextPath}/template/student/'+evalTaskDeptId" target="_blank">
                            <img style="width: 20px" alt="学生评价导入-模板" src="${request.contextPath}/statics/img/ico_excel.jpg" />
                            <span style="font-size:larger;font-weight:200;color:red">学生评价导入-模板.xls</span>
                        </a>
                    </div>
                </div>
                <div class="row">
                    <input type="file" name="xlsRecordFile" id="xlsRecordFile" class="file-loading">
                </div>
            </div>
        </div>
        <div class="form-group" v-show="showRecordImportResult">
            <div class="col-sm-2 control-label">异常结果</div>
            <div class="col-sm-10">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>工号</th>
                        <th>姓名</th>
                        <th>成绩</th>
                        <th>原因</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="warning" v-for="(item, index) in importRecordErrorList" :key="index">
                        <td>{{index+1}}</td>
                        <td>{{item.username}}</td>
                        <td>{{item.name}}</td>
                        <td>{{item.score}}</td>
                        <td>{{item.reason}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="form-group" v-show="showRecordImportResult">
            <div class="col-sm-2 control-label">成功结果</div>
            <div class="col-sm-10">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>工号</th>
                        <th>姓名</th>
                        <th>成绩</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="success"v-for="(item, index) in importRecordSuccessList" :key="index">
                        <td>{{index+1}}</td>
                        <td>{{item.username}}</td>
                        <td>{{item.name}}</td>
                        <td>{{item.score}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-warning" @click="recordListReload" value="返回"/>
        </div>
    </form>
</div>
<div v-show="showRecordUpdate" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-sm-2 control-label">姓名</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="studentEvalRecord.userName" placeholder="姓名" readonly/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">分数</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" v-model="studentEvalRecord.score" placeholder="分数"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">备注</div>
            <div class="col-sm-10">
                <textarea  class="form-control" v-model="studentEvalRecord.remark" rows="6"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label"></div>
            <input type="button" class="btn btn-primary" id="btnUpdate" data-loading-text="保存中..." @click="updateRecord" value="确定"/>
            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="recordListReload" value="返回"/>
        </div>
    </form>
</div>


<!-- 选择用户 -->
<div id="userLayer" style="display: none;padding:10px;">
    <div class="row">
        <div class="col-sm-4">
            选择部门
        </div>
        <div class="col-sm-8">
            选择具体执行人
        </div>
    </div>
    <div class="row">
        <div class="col-sm-4">
            <ul id="deptTree1" class="ztree"></ul>
        </div>
        <div class="col-sm-8">
            <div class="row">
                <div class="col-sm-9">
                    <div class="input-group">
                        <div class="input-group-addon">姓名</div>
                        <input type="text" class="form-control" @change="findUser" v-model="layer.qName" placeholder="输入姓名"/>
                    </div>
                </div>
                <div class="col-sm-3">
                    <input type="button" class="btn btn-primary" @click="findUser" value="搜索"/>
                </div>
            </div>
            <div class="col-sm-12">
                <table class="table table-fixed">
                    <thead>
                    <tr>
                        <th class="col-sm-6">工号</th>
                        <th class="col-sm-6">姓名</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(user,index) in layer.userList" @click="layerChooseUser(index)">
                        <td class="col-sm-6">{{ user.username }}</td>
                        <td class="col-sm-6">{{ user.name }}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-8">
            <div class="form-inline">
                <div class="input-group">
                    <div class="input-group-addon">选择结果：</div>
                    <div class="input-group-addon">工号</div>
                    <input type="text" class="form-control" v-model="layer.chooseUser.username" readonly/>
                    <div class="input-group-addon">姓名</div>
                    <input type="text" class="form-control" v-model="layer.chooseUser.name" readonly/>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script src="${request.contextPath}/statics/js/modules/eval/studentevaltask.js?_${.now?long}"></script>
</body>
</html>